﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using AspNetCs.Model;
using AspNetCs.Bll;
using AspNetCs.Common;

public partial class Master_Admin_SendMessage :Admin_BasePage
{
    private MessageBLL messageBLL = Message_BLL.CreateNew;

    protected void Page_Load(object sender, EventArgs e)
    {
        IsExit();
        if (!IsPostBack)
        {

        }
    }


    protected void btnSubmit_Click(object sender,EventArgs e)
    {
        MessageModel model = new MessageModel();

        int UserId = 0;
        UserId = AdminInfo.Id;
        string title = txtTitle.Text;
        string content = WebEditor1.Text;
        model.Content = content;
        model.Title = txtTitle.Text;
        model.IsDel = 0;
        model.ReciverId = 0;
        model.ReciverIsMaster = 0;
        model.SenderId = UserId;
        model.SenderIsMaster = 1;
        model.IsAll = 1;
        int i = messageBLL.Add(model);
        if (i > 0)
        {
            ResultStr("Admin_ManageMessage.aspx", "发送成功!");
        }
        else
        {
            ResultStr("Admin_ManageMessage.aspx", "发送失败!");
        }

    }
}
